<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ page
	import="com.onlineMIS.common.Common_util,java.util.Date,java.text.SimpleDateFormat"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>禧乐仓连锁店管理信息系统</title>
<%@ include file="../../../common/Style.jsp"%>
<link href="<%=request.getContextPath()%>/conf_files/css/pagination.css"
	rel="stylesheet" type="text/css" />
<SCRIPT src="<%=request.getContextPath()%>/conf_files/js/pagenav1.1.js"
	type=text/javascript></SCRIPT>
<script>
var dataGrid ;
$(document).ready(function(){
	parent.$.messager.progress('close'); 
	$("#billType").combobox('setValue',null);
	 
	 var params = $.serializeObject($('#financeBillSearchForm')); 
	
	dataGrid =  $('#suppliceDataGrid').datagrid({
		url : 'financeSupplierJSON!searchFHQBill',
		queryParams: params,
		fit : true,
		fitColumns : true,
		pagination : true,
		pageSize : 15,
		pageList : [ 15, 30],
		border : false,
		checkOnSelect : false,
		selectOnCheck : false,
		singleSelect:true,
		showFooter:true,
		rownumbers:true,
		nowrap : false,
		rowStyler: function(index,row){
			var style = "";
			if (row.status == 1)
				style += 'color:blue;';
			else if (row.status == 3)
				style += 'color:red;';				
			return style;
		},
		columns : [ [
				    {field:'id', width:3,title:'编号'},
					{field:'supplierName', width:8,title:'供应商名字'},
					{field:'typeHQS', width:5,title:'单据种类'},
					{field:'creatorHqName', width:5,title:'创建人'},
					{field:'billDate', width:5,title:'单据日期'},
					{field:'createDate', width:5,title:'创建日期'},
					{field:'updateDate', width:5,title:'更新日期'},
					{field:'invoiceTotal', width:5,title:'金额'},
					{field:'statusS', width:5,title:'状态'},
					{field:'comment', width:10,title:'备注'},
					{
						field:'details', 
						width:5,
						title:'详情',
						formatter : function(value, row, index) {
							var str = '';
							var url = "financeSupplierJSP!getFHQ?formBean.order.id=" + row.id;
							var nodeTitle = "财务单据"+ row.id;
							if (row.id != 0){							  					
								 str += $.formatString('<a href="javascript:addTab3(\'{0}\',\'{1}\');"><img border="0" src="{2}" title="详情"/></a>',url,nodeTitle,'<%=request.getContextPath()%>/conf_files/easyUI/themes/icons/update.png');							
							}
							return str;
						}
					},
			     ]],
		toolbar : '#supplierToolbar'
	
	});
});

/**
 * 查询单据详情
 */
function selectOrderDetails(orderId){
	$.messager.progress({
		title : '提示',
		text : '数据处理中，请稍后....'
	});
	//<a href='#' onclick='addTab3(\""+urlLink+"\",\""+nodeTitle+"\")'><img src='<%=request.getContextPath()%>/conf_files/web-image/editor.gif' border='0'/></a>
	//financeSupplierJSP!getFHQ?formBean.order.id=" + bills[i].id;
	//window.location.href = "chainSalesJSPAction!getSalesOrderById?formBean.chainSalesOrder.id=" + orderId;

}

/**
 * 搜索单据
 */
function searchBills(){
	var params = $.serializeObject($('#financeBillSearchForm')); 
	$('#suppliceDataGrid').datagrid('load',params); 
}

</script>
</head>
<body>

<div class="easyui-layout" data-options="fit : true,border : false">
	<div data-options="region:'north',border:false" style="height: 125px;">
	<s:form id="financeBillSearchForm" name="financeBillSearchForm"
		action="/actionChain/inventoryFlowAction!searchInvenOrder"
		theme="simple" method="POST">
		<%@ include file="../../../common/pageForm.jsp"%>
		<table width="98%" align="center" class="OuterTable">
			<tr>
				<td>
					<table width="100%" border="0">
						<tr>
							<td height="50" colspan="7">
								<div class="errorAndmes">
									<s:actionerror cssStyle="color:red" />
									<s:actionmessage cssStyle="color:blue" />
								</div>
								<table width="100%" border="0">
									<tr class="PBAOuterTableTitale">
										<td height="35" colspan="6">搜索供应商财务单据
										</td>
									</tr>
									<tr class="InnerTableContent">										
										<td  width="20%"><%@ include file="../SupplierInput.jsp"%>									
										<td width="20%"><strong>单据日期 ：</strong> <s:textfield id="startDate"
												name="formBean.searchStartTime" cssClass="easyui-datebox"
												data-options="width:100,editable:false" />-												
										<s:textfield id="endDate"
												name="formBean.searchEndTime" cssClass="easyui-datebox"
												data-options="width:100,editable:false" />																			
										</td>
										<td width="15%"><strong>单据状态：    </strong><s:select name="formBean.order.status" cssClass="easyui-combobox" style="width:140px;text-align: center"
												list="formBean.order.statusMap" listKey="key"
												listValue="value" headerKey="" headerValue=""  data-options="prompt:'请选择单据状态!'" /></td>
										
										<td width="15%"><strong>单据种类：  </strong><s:select name="formBean.order.type" id="billType"
												list="formBean.order.typeHQMap" listKey="key" cssClass="easyui-combobox" style="width:140px;text-align: center"
												listValue="value" headerKey="" headerValue="" data-options="prompt:'请选择单据种类!'" /></td>
										<td ><strong>单据摘要: </strong><s:textfield id="comment" cssClass="easyui-textbox" data-options="prompt:'请输入单据摘要!'"
												name="formBean.order.comment" /></td>		
									</tr>

	

								</table>
							</td>
						</tr>
						
					</table>
				</td>
			</tr>
		</table>
	</s:form>
	
		</div>
	
		<div data-options="region:'center',border:false">
			<table id="suppliceDataGrid">
			</table>
		</div>
	</div>
		
	<div id="supplierToolbar" style="display: none;">
		<a onclick="searchBills();" href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">搜索单据</a>
		<s:if test="#session.LOGIN_CHAIN_USER.containFunction('financeSupplierJSON!searchFHQBill')">																						
			<a onclick="searchBills();" href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">搜索单据</a>
		</s:if>
	</div>	

</body>
</html>